## API Report File for "@backstage/core-app-api"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { AlertApi } from '@backstage/core-plugin-api';
import { AlertMessage } from '@backstage/core-plugin-api';
import { AnalyticsApi } from '@backstage/core-plugin-api';
import { AnalyticsEvent } from '@backstage/core-plugin-api';
import { AnyApiFactory } from '@backstage/core-plugin-api';
import { AnyApiRef } from '@backstage/core-plugin-api';
import { ApiFactory } from '@backstage/core-plugin-api';
import { ApiHolder } from '@backstage/core-plugin-api';
import { ApiRef } from '@backstage/core-plugin-api';
import { AppConfig } from '@backstage/config';
import { AppTheme } from '@backstage/core-plugin-api';
import { AppThemeApi } from '@backstage/core-plugin-api';
import { atlassianAuthApiRef } from '@backstage/core-plugin-api';
import { AuthProviderInfo } from '@backstage/core-plugin-api';
import { AuthRequestOptions } from '@backstage/core-plugin-api';
import { BackstageIdentityApi } from '@backstage/core-plugin-api';
import { BackstageIdentityResponse } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { bitbucketAuthApiRef } from '@backstage/core-plugin-api';
import { bitbucketServerAuthApiRef } from '@backstage/core-plugin-api';
import { ComponentType } from 'react';
import { Config } from '@backstage/config';
import { ConfigApi } from '@backstage/core-plugin-api';
import { ConfigReader } from '@backstage/config';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { ErrorApi } from '@backstage/core-plugin-api';
import { ErrorApiError } from '@backstage/core-plugin-api';
import { ErrorApiErrorContext } from '@backstage/core-plugin-api';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { FeatureFlag } from '@backstage/core-plugin-api';
import { FeatureFlagsApi } from '@backstage/core-plugin-api';
import { FeatureFlagsSaveOptions } from '@backstage/core-plugin-api';
import { FetchApi } from '@backstage/core-plugin-api';
import { githubAuthApiRef } from '@backstage/core-plugin-api';
import { gitlabAuthApiRef } from '@backstage/core-plugin-api';
import { googleAuthApiRef } from '@backstage/core-plugin-api';
import { IconComponent } from '@backstage/core-plugin-api';
import { IdentityApi } from '@backstage/core-plugin-api';
import { JsonValue } from '@backstage/types';
import { microsoftAuthApiRef } from '@backstage/core-plugin-api';
import { OAuthApi } from '@backstage/core-plugin-api';
import { OAuthRequestApi } from '@backstage/core-plugin-api';
import { OAuthRequester } from '@backstage/core-plugin-api';
import { OAuthRequesterOptions } from '@backstage/core-plugin-api';
import { Observable } from '@backstage/types';
import { oktaAuthApiRef } from '@backstage/core-plugin-api';
import { oneloginAuthApiRef } from '@backstage/core-plugin-api';
import { OpenIdConnectApi } from '@backstage/core-plugin-api';
import { PendingOAuthRequest } from '@backstage/core-plugin-api';
import { ProfileInfo } from '@backstage/core-plugin-api';
import { ProfileInfoApi } from '@backstage/core-plugin-api';
import { PropsWithChildren } from 'react';
import PropTypes from 'prop-types';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { SessionApi } from '@backstage/core-plugin-api';
import { SessionState } from '@backstage/core-plugin-api';
import { StorageApi } from '@backstage/core-plugin-api';
import { StorageValueSnapshot } from '@backstage/core-plugin-api';
import { SubRouteRef } from '@backstage/core-plugin-api';
import { vmwareCloudAuthApiRef } from '@backstage/core-plugin-api';

// @public
export class AlertApiForwarder implements AlertApi {
  // (undocumented)
  alert$(): Observable<AlertMessage>;
  // (undocumented)
  post(alert: AlertMessage): void;
}

// @public (undocumented)
export type ApiFactoryHolder = {
  get<T>(api: ApiRef<T>):
    | ApiFactory<
        T,
        T,
        {
          [key in string]: unknown;
        }
      >
    | undefined;
};

// @public
export class ApiFactoryRegistry implements ApiFactoryHolder {
  // (undocumented)
  get<T>(api: ApiRef<T>):
    | ApiFactory<
        T,
        T,
        {
          [x: string]: unknown;
        }
      >
    | undefined;
  // (undocumented)
  getAllApis(): Set<AnyApiRef>;
  register<
    Api,
    Impl extends Api,
    Deps extends {
      [name in string]: unknown;
    },
  >(scope: ApiFactoryScope, factory: ApiFactory<Api, Impl, Deps>): boolean;
}

// @public
export type ApiFactoryScope = 'default' | 'app' | 'static';

// @public
export const ApiProvider: {
  (props: PropsWithChildren<ApiProviderProps>): React_2.JSX.Element;
  propTypes: {
    apis: PropTypes.Validator<
      NonNullable<
        PropTypes.InferProps<{
          get: PropTypes.Validator<(...args: any[]) => any>;
        }>
      >
    >;
    children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
  };
};

// @public
export type ApiProviderProps = {
  apis: ApiHolder;
  children: ReactNode;
};

// @public
export class ApiResolver implements ApiHolder {
  constructor(factories: ApiFactoryHolder);
  // (undocumented)
  get<T>(ref: ApiRef<T>): T | undefined;
  static validateFactories(
    factories: ApiFactoryHolder,
    apis: Iterable<AnyApiRef>,
  ): void;
}

// @public
export type AppComponents = {
  NotFoundErrorPage: ComponentType<PropsWithChildren<{}>>;
  BootErrorPage: ComponentType<BootErrorPageProps>;
  Progress: ComponentType<PropsWithChildren<{}>>;
  Router: ComponentType<
    PropsWithChildren<{
      basename?: string;
    }>
  >;
  ErrorBoundaryFallback: ComponentType<ErrorBoundaryFallbackProps>;
  ThemeProvider?: ComponentType<PropsWithChildren<{}>>;
  SignInPage?: ComponentType<SignInPageProps>;
};

// @public
export type AppConfigLoader = () => Promise<AppConfig[]>;

// @public
export type AppContext = {
  getPlugins(): BackstagePlugin[];
  getSystemIcon(key: string): IconComponent | undefined;
  getSystemIcons(): Record<string, IconComponent>;
  getComponents(): AppComponents;
};

// @public
export type AppIcons = {
  'kind:api': IconComponent;
  'kind:component': IconComponent;
  'kind:domain': IconComponent;
  'kind:group': IconComponent;
  'kind:location': IconComponent;
  'kind:system': IconComponent;
  'kind:user': IconComponent;
  'kind:resource': IconComponent;
  'kind:template': IconComponent;
  brokenImage: IconComponent;
  catalog: IconComponent;
  chat: IconComponent;
  dashboard: IconComponent;
  docs: IconComponent;
  email: IconComponent;
  github: IconComponent;
  group: IconComponent;
  help: IconComponent;
  scaffolder: IconComponent;
  search: IconComponent;
  techdocs: IconComponent;
  user: IconComponent;
  warning: IconComponent;
};

// @public
export type AppOptions = {
  apis?: Iterable<AnyApiFactory>;
  defaultApis?: Iterable<AnyApiFactory>;
  icons: AppIcons & {
    [key in string]: IconComponent;
  };
  plugins?: Array<
    BackstagePlugin & {
      output?(): Array<
        | {
            type: 'feature-flag';
            name: string;
          }
        | {
            type: string;
          }
      >;
    }
  >;
  featureFlags?: (FeatureFlag & Omit<FeatureFlag, 'pluginId'>)[];
  components: AppComponents;
  themes: (Partial<AppTheme> & Omit<AppTheme, 'theme'>)[];
  configLoader?: AppConfigLoader;
  bindRoutes?(context: { bind: AppRouteBinder }): void;
  __experimentalTranslations?: {
    defaultLanguage?: string;
    availableLanguages?: string[];
    resources?: Array<
      | {
          $$type: '@backstage/TranslationResource';
          id: string;
        }
      | {
          $$type: '@backstage/TranslationMessages';
          id: string;
          full: boolean;
          messages: Record<string, string>;
        }
    >;
  };
};

// @public
export type AppRouteBinder = <
  ExternalRoutes extends {
    [name: string]: ExternalRouteRef;
  },
>(
  externalRoutes: ExternalRoutes,
  targetRoutes: PartialKeys<
    TargetRouteMap<ExternalRoutes>,
    KeysWithType<ExternalRoutes, ExternalRouteRef<any, true>>
  >,
) => void;

// @public
export function AppRouter(props: AppRouterProps): React_2.JSX.Element;

// @public
export interface AppRouterProps {
  // (undocumented)
  children?: ReactNode;
}

// @public
export class AppThemeSelector implements AppThemeApi {
  constructor(themes: AppTheme[]);
  // (undocumented)
  activeThemeId$(): Observable<string | undefined>;
  // (undocumented)
  static createWithStorage(themes: AppTheme[]): AppThemeSelector;
  // (undocumented)
  getActiveThemeId(): string | undefined;
  // (undocumented)
  getInstalledThemes(): AppTheme[];
  // (undocumented)
  setActiveThemeId(themeId?: string): void;
}

// @public
export class AtlassianAuth {
  // (undocumented)
  static create(options: OAuthApiCreateOptions): typeof atlassianAuthApiRef.T;
}

// @public
export type AuthApiCreateOptions = {
  discoveryApi: DiscoveryApi;
  environment?: string;
  provider?: AuthProviderInfo;
  configApi?: ConfigApi;
};

// @public
export type BackstageApp = {
  getPlugins(): BackstagePlugin[];
  getSystemIcon(key: string): IconComponent | undefined;
  createRoot(element: JSX.Element): ComponentType<PropsWithChildren<{}>>;
  getProvider(): ComponentType<PropsWithChildren<{}>>;
  getRouter(): ComponentType<PropsWithChildren<{}>>;
};

// @public
export class BitbucketAuth {
  // (undocumented)
  static create(options: OAuthApiCreateOptions): typeof bitbucketAuthApiRef.T;
}

// @public
export class BitbucketServerAuth {
  // (undocumented)
  static create(
    options: OAuthApiCreateOptions,
  ): typeof bitbucketServerAuthApiRef.T;
}

// @public
export type BitbucketServerSession = {
  providerInfo: {
    accessToken: string;
    scopes: Set<string>;
    expiresAt?: Date;
  };
  profile: ProfileInfo;
  backstageIdentity: BackstageIdentityResponse;
};

// @public
export type BitbucketSession = {
  providerInfo: {
    accessToken: string;
    scopes: Set<string>;
    expiresAt?: Date;
  };
  profile: ProfileInfo;
  backstageIdentity: BackstageIdentityResponse;
};

// @public
export type BootErrorPageProps = PropsWithChildren<{
  step: 'load-config' | 'load-chunk';
  error: Error;
}>;

export { ConfigReader };

// @public
export function createFetchApi(options: {
  baseImplementation?: typeof fetch | undefined;
  middleware?: FetchMiddleware | FetchMiddleware[] | undefined;
}): FetchApi;

// @public
export function createSpecializedApp(options: AppOptions): BackstageApp;

// @public
export const defaultConfigLoader: AppConfigLoader;

// @public
export class ErrorAlerter implements ErrorApi {
  constructor(alertApi: AlertApi, errorApi: ErrorApi);
  // (undocumented)
  error$(): Observable<{
    error: ErrorApiError;
    context?: ErrorApiErrorContext | undefined;
  }>;
  // (undocumented)
  post(error: ErrorApiError, context?: ErrorApiErrorContext): void;
}

// @public
export class ErrorApiForwarder implements ErrorApi {
  // (undocumented)
  error$(): Observable<{
    error: Error;
    context?: ErrorApiErrorContext;
  }>;
  // (undocumented)
  post(error: ErrorApiError, context?: ErrorApiErrorContext): void;
}

// @public
export type ErrorBoundaryFallbackProps = PropsWithChildren<{
  plugin?: BackstagePlugin;
  error: Error;
  resetError: () => void;
}>;

// @public
export const FeatureFlagged: (
  props: FeatureFlaggedProps,
) => React_2.JSX.Element;

// @public
export type FeatureFlaggedProps = {
  children: ReactNode;
} & (
  | {
      with: string;
    }
  | {
      without: string;
    }
);

// @public
export interface FetchMiddleware {
  apply(next: typeof fetch): typeof fetch;
}

// @public
export class FetchMiddlewares {
  static injectIdentityAuth(options: {
    identityApi: IdentityApi;
    config?: Config;
    urlPrefixAllowlist?: string[];
    allowUrl?: (url: string) => boolean;
    header?: {
      name: string;
      value: (backstageToken: string) => string;
    };
  }): FetchMiddleware;
  static resolvePluginProtocol(options: {
    discoveryApi: DiscoveryApi;
  }): FetchMiddleware;
}

// @public
export const FlatRoutes: (props: FlatRoutesProps) => JSX.Element | null;

// @public
export type FlatRoutesProps = {
  children: ReactNode;
};

// @public
export class FrontendHostDiscovery implements DiscoveryApi {
  static fromConfig(
    config: Config,
    options?: {
      pathPattern?: string;
    },
  ): FrontendHostDiscovery;
  // (undocumented)
  getBaseUrl(pluginId: string): Promise<string>;
}

// @public
export class GithubAuth {
  // (undocumented)
  static create(options: OAuthApiCreateOptions): typeof githubAuthApiRef.T;
}

// @public
export class GitlabAuth {
  // (undocumented)
  static create(options: OAuthApiCreateOptions): typeof gitlabAuthApiRef.T;
}

// @public
export class GoogleAuth {
  // (undocumented)
  static create(options: OAuthApiCreateOptions): typeof googleAuthApiRef.T;
}

// @public
export class LocalStorageFeatureFlags implements FeatureFlagsApi {
  // (undocumented)
  getRegisteredFlags(): FeatureFlag[];
  // (undocumented)
  isActive(name: string): boolean;
  // (undocumented)
  registerFlag(flag: FeatureFlag): void;
  // (undocumented)
  save(options: FeatureFlagsSaveOptions): void;
}

// @public
export class MicrosoftAuth {
  // (undocumented)
  static create(options: OAuth2CreateOptions): typeof microsoftAuthApiRef.T;
  // (undocumented)
  getAccessToken(
    scope?: string | string[],
    options?: AuthRequestOptions,
  ): Promise<string>;
  // (undocumented)
  getBackstageIdentity(
    options?: AuthRequestOptions,
  ): Promise<BackstageIdentityResponse | undefined>;
  // (undocumented)
  getIdToken(options?: AuthRequestOptions): Promise<string>;
  // (undocumented)
  getProfile(options?: AuthRequestOptions): Promise<ProfileInfo | undefined>;
  // (undocumented)
  sessionState$(): Observable<SessionState>;
  // (undocumented)
  signIn(): Promise<void>;
  // (undocumented)
  signOut(): Promise<void>;
}

// @public
export class MultipleAnalyticsApi implements AnalyticsApi {
  captureEvent(event: AnalyticsEvent): void;
  static fromApis(actualApis: AnalyticsApi[]): MultipleAnalyticsApi;
}

// @public
export class NoOpAnalyticsApi implements AnalyticsApi {
  // (undocumented)
  captureEvent(_event: AnalyticsEvent): void;
}

// @public
export class OAuth2
  implements
    OAuthApi,
    OpenIdConnectApi,
    ProfileInfoApi,
    BackstageIdentityApi,
    SessionApi
{
  // (undocumented)
  static create(options: OAuth2CreateOptions): OAuth2;
  // (undocumented)
  getAccessToken(
    scope?: string | string[],
    options?: AuthRequestOptions,
  ): Promise<string>;
  // (undocumented)
  getBackstageIdentity(
    options?: AuthRequestOptions,
  ): Promise<BackstageIdentityResponse | undefined>;
  // (undocumented)
  getIdToken(options?: AuthRequestOptions): Promise<string>;
  // (undocumented)
  getProfile(options?: AuthRequestOptions): Promise<ProfileInfo | undefined>;
  // (undocumented)
  sessionState$(): Observable<SessionState>;
  // (undocumented)
  signIn(): Promise<void>;
  // (undocumented)
  signOut(): Promise<void>;
}

// @public
export type OAuth2CreateOptions = OAuthApiCreateOptions & {
  scopeTransform?: (scopes: string[]) => string[];
  popupOptions?: PopupOptions;
};

// @public
export type OAuth2Session = {
  providerInfo: {
    idToken: string;
    accessToken: string;
    scopes: Set<string>;
    expiresAt?: Date;
  };
  profile: ProfileInfo;
  backstageIdentity?: BackstageIdentityResponse;
};

// @public
export type OAuthApiCreateOptions = AuthApiCreateOptions & {
  oauthRequestApi: OAuthRequestApi;
  defaultScopes?: string[];
};

// @public
export class OAuthRequestManager implements OAuthRequestApi {
  // (undocumented)
  authRequest$(): Observable<PendingOAuthRequest[]>;
  // (undocumented)
  createAuthRequester<T>(options: OAuthRequesterOptions<T>): OAuthRequester<T>;
}

// @public
export class OktaAuth {
  // (undocumented)
  static create(options: OAuthApiCreateOptions): typeof oktaAuthApiRef.T;
}

// @public
export class OneLoginAuth {
  // (undocumented)
  static create(
    options: OneLoginAuthCreateOptions,
  ): typeof oneloginAuthApiRef.T;
}

// @public
export type OneLoginAuthCreateOptions = {
  configApi?: ConfigApi;
  discoveryApi: DiscoveryApi;
  oauthRequestApi: OAuthRequestApi;
  environment?: string;
  provider?: AuthProviderInfo;
};

// @public
export type PopupOptions = {
  size?:
    | {
        width: number;
        height: number;
        fullscreen?: never;
      }
    | {
        width?: never;
        height?: never;
        fullscreen: boolean;
      };
};

// @public
export class SamlAuth
  implements ProfileInfoApi, BackstageIdentityApi, SessionApi
{
  // (undocumented)
  static create(options: AuthApiCreateOptions): SamlAuth;
  // (undocumented)
  getBackstageIdentity(
    options?: AuthRequestOptions,
  ): Promise<BackstageIdentityResponse | undefined>;
  // (undocumented)
  getProfile(options?: AuthRequestOptions): Promise<ProfileInfo | undefined>;
  // (undocumented)
  sessionState$(): Observable<SessionState>;
  // (undocumented)
  signIn(): Promise<void>;
  // (undocumented)
  signOut(): Promise<void>;
}

// @public
export type SignInPageProps = PropsWithChildren<{
  onSignInSuccess(identityApi: IdentityApi): void;
}>;

// @public
export class UnhandledErrorForwarder {
  static forward(errorApi: ErrorApi, errorContext: ErrorApiErrorContext): void;
}

// @public
export class UrlPatternDiscovery implements DiscoveryApi {
  static compile(pattern: string): UrlPatternDiscovery;
  // (undocumented)
  getBaseUrl(pluginId: string): Promise<string>;
}

// @public
export class VMwareCloudAuth {
  // (undocumented)
  static create(options: OAuthApiCreateOptions): typeof vmwareCloudAuthApiRef.T;
}

// @public
export class WebStorage implements StorageApi {
  constructor(namespace: string, errorApi: ErrorApi);
  // (undocumented)
  static create(options: {
    errorApi: ErrorApi;
    namespace?: string;
  }): WebStorage;
  // (undocumented)
  forBucket(name: string): WebStorage;
  // (undocumented)
  get<T>(key: string): T | undefined;
  // (undocumented)
  observe$<T extends JsonValue>(
    key: string,
  ): Observable<StorageValueSnapshot<T>>;
  // (undocumented)
  remove(key: string): Promise<void>;
  // (undocumented)
  set<T>(key: string, data: T): Promise<void>;
  // (undocumented)
  snapshot<T extends JsonValue>(key: string): StorageValueSnapshot<T>;
}
```
